classdef GR_Axis
    properties
        FontSize
        Exponent
        TickFmt
        Grid
        Box
        BoxColor
    end
    methods
        function obj=GR_Axis(Input)
            arguments
                Input.FontSize struct   =   struct('X',10,'Y',10);
                Input.Exponent struct   =   struct('X',0,'Y',0);
                Input.TickFmt struct    =   struct('X','%g','Y','%g');
                Input.Grid struct       =   struct('X','on','Y','on');
                Input.Box char          =   'on';
                Input.BoxColor struct   =   struct('X','k','Y','k');
            end
            obj.FontSize    =   Input.FontSize;
            obj.Exponent    =   Input.Exponent;
            obj.TickFmt     =   Input.TickFmt;
            obj.Grid        =   Input.Grid;
            obj.Box         =   Input.Box;
            obj.BoxColor    =   Input.BoxColor;
        end
        function Setup(obj,ax)
            XY  =   {'X','Y'};
            for ii=1:length(XY)
                Axis    =   [XY{ii},'Axis'];
                
                ax.(Axis).FontSize          =   obj.FontSize.(XY{ii});
                ax.(Axis).Label.FontSize    =   obj.FontSize.(XY{ii});
                ax.(Axis).Exponent          =   obj.Exponent.(XY{ii});
                ax.(Axis).TickLabelFormat   =   obj.TickFmt.(XY{ii});
                ax.(Axis).Label.Interpreter =   'latex';
                
                ax.([XY{ii},'Grid'])        =   obj.Grid.(XY{ii});
                ax.([XY{ii},'Color'])       =   obj.BoxColor.(XY{ii});
            end
            box(ax,obj.Box);
        end
    end
end